package xyz.archknight.app.loginput.dictionary.gen.ui.component

import com.formdev.flatlaf.extras.FlatSVGIcon
import javax.swing.JButton
import javax.swing.JComponent
import kotlin.reflect.KProperty

/**
 * SVG图标按钮组件
 *
 * @author midnite
 * create at 2020-06-18 3:34 下午
 */
class SVGButton(
    iconName: String="",
    labelText: String="",
    tip: String=""
) : JButton() {
    init {
        if (iconName.isNotEmpty()) {
            icon = FlatSVGIcon("icons/${iconName}.svg")
        }
        if (labelText.isNotEmpty()) {
            text = labelText
        }
        if (tip.isNotEmpty()) {
            toolTipText = tip
        }
    }
}